part of pda.service;

class Provider {
  String id;
  String code;
  String name;
  String spell;
  String linkman;
  String handset;
  String address; // column: branch_id
  String jyfs;

  Provider(
      {this.id,
      this.code,
      this.name,
      this.spell,
      this.linkman,
      this.handset,
      this.address,
      this.jyfs});

  factory Provider.fromJson(Map<String, dynamic> map) {
    return Provider(
        id: map['id'],
        code: map['code'],
        name: map['name'],
        spell: map['spell'],
        linkman: map['linkman'],
        handset: map['handset'],
        address: map['address'],
        jyfs: map['jyfs']);
  }

  static String insertSql() {
    return '''insert into pda_provider (
      id,
      code,
      name,
      spell,
      linkman,
      handset,
      address,
      jyfs
    ) values (
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?
    )
    ''';
  }

  List<dynamic> insertSqlArgs() {
    return [
      id,
      code,
      name,
      spell,
      linkman,
      handset,
      address,
      jyfs,
    ];
  }
}
